package com.gxkj.demo.kafka.controllers;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/demo/kafka")
public class ProducterController {

    @RequestMapping(value="",method= RequestMethod.GET)
    public String index(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap){
        return "kafka/kafka_index";
    }

    @RequestMapping(value="send",method= RequestMethod.GET)
    public void send(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap){
        new ProducerDemo().produce();
    }
}
